﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Customers.aspx.cs" Inherits="FE_Customers" Title="Untitled Page" %>
<%@ Register Src="~/UserControl/CustomerFiltering.ascx" TagName="CustomerFiltering" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageContent" Runat="Server">
    <uc:CustomerFiltering ID="uxFiltering" runat="server" OnSearched="DoSearchClick" />
     <div class="section-separator"></div>
    <gr:Container ID="Container1" runat="server" HeaderText="Danh sách khách hàng">        
        <gr:GuruGrid runat="server" ID="uxCustomersGrid" AllowSorting="true" AllowFilteringByColumn="false"  
            AllowPaging="true" PageSize="10" OnNeedDataSource="uxCustomersGrid_NeedDataSource"
             OnItemDataBound="uxCustomersGrid_ItemDataBound" OnItemCommand="uxCustomersGrid_ItemCommand">
            <MasterTableView DataKeyNames="GuestID">
                <Columns>
                    <gr:GuruGridBoundColumn UniqueName="SeqNumber" Format="Sequence" HeaderText="Seq"/>
                    <gr:GuruGridTemplateColumn ItemStyle-Width="50px">
                        <ItemTemplate>
                            <gr:LinkButton CssClass="rgLinkIcon rgLinkDel" runat="server" OnClientClick="return ValidateDelete();" IsStandard="true" ID="uxDelete" Text="Xóa" CommandName="Delete"></gr:LinkButton>
                        </ItemTemplate>
                    </gr:GuruGridTemplateColumn>                                
                    <gr:GuruGridBoundColumn UniqueName="GuestCode" DataField="GuestCode" Format="StaticString" HeaderText="Mã khách hàng"/>
                    <gr:GuruGridBoundColumn UniqueName="GuestName" DataField="GuestName" HeaderText="Tên khách hàng"/>
                    <gr:GuruGridBoundColumn UniqueName="Identify" DataField="Identify" Format="StaticString" HeaderText="CMND/Passport"/>
                    <gr:GuruGridBoundColumn UniqueName="Phone" DataField="Phone" Format="Phone" HeaderText="Điện thoại"/>
                    <gr:GuruGridBoundColumn UniqueName="Address" DataField="Address" HeaderText="Địa chỉ"/>
                    <gr:GuruGridBoundColumn UniqueName="Email" DataField="Email" HeaderText="Email"/>
                    <gr:GuruGridBoundColumn UniqueName="Status" DataField="Status" HeaderText="Trạng thái" Format="StaticString" />
                    
                </Columns>
            </MasterTableView>
        </gr:GuruGrid>
    </gr:Container>
    <div class="ContainerInput">
        <gr:ContainerButton ID="ContainerButton1" runat="server">
            <gr:LinkButton Text="Thêm" runat="server" ID="uxAddNew" CssClass="button buttonGray buttonFixedShort" OnClientClick="OpenPopupModal(1, 'CustomerDetails.aspx'); return false;"
                SizeType="FixedSmallShort" CssClassIcon="icon_add" IsStandard="false" />
           
        </gr:ContainerButton>
    </div>
    <script type="text/javascript">
        function ReloadPage(){
           ReloadRadGrid("<%=uxCustomersGrid.ClientID %>");
        }
        function ValidateDelete()
        {           
            var msg_confirm = '<%=Resources.MessageManager.ConfirmToDelete %>';            
            var confirmed = confirm(msg_confirm);
            return confirmed;
        }
    </script>
</asp:Content>

